package mya.mes.mdc.model.tag.convert;

import com.alibaba.fastjson.JSONObject;
import mya.mes.mdc.model.alarm.Alarm;

public class AlarmConverter {

  public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, Alarm obj) {
    for (java.util.Map.Entry<String, Object> member : json) {
      switch (member.getKey()) {
        case "alarmDate":
          if (member.getValue() instanceof String) {
            obj.setAlarmDate((String)member.getValue());
          }
          break;
        case "alarmNo":
          if (member.getValue() instanceof String) {
            obj.setAlarmNo((String)member.getValue());
          }
          break;
        case "alarmSeq":
          if (member.getValue() instanceof Number) {
            obj.setAlarmSeq(((Number)member.getValue()).intValue());
          }
          break;
        case "alarmTime":
          if (member.getValue() instanceof String) {
            obj.setAlarmTime((String)member.getValue());
          }
          break;
        case "area":
          if (member.getValue() instanceof String) {
            obj.setArea((String)member.getValue());
          }
          break;
        case "closeDate":
          if (member.getValue() instanceof String) {
            obj.setCloseDate((String)member.getValue());
          }
          break;
        case "closeTime":
          if (member.getValue() instanceof String) {
            obj.setCloseTime((String)member.getValue());
          }
          break;
        case "closed":
          if (member.getValue() instanceof Boolean) {
            obj.setClosed((Boolean)member.getValue());
          }
          break;
        case "enUs":
          if (member.getValue() instanceof String) {
            obj.setEnUs((String)member.getValue());
          }
          break;
        case "maint":
          if (member.getValue() instanceof Boolean) {
            obj.setMaint((Boolean)member.getValue());
          }
          break;
        case "managerSent":
          if (member.getValue() instanceof Boolean) {
            obj.setManagerSent((Boolean)member.getValue());
          }
          break;
        case "mdcTag":
          if (member.getValue() instanceof String) {
            obj.setMdcTag((String)member.getValue());
          }
          break;
        case "mdcTagIndex":
          if (member.getValue() instanceof Number) {
            obj.setMdcTagIndex(((Number)member.getValue()).intValue());
          }
          break;
        case "msgNotice":
          if (member.getValue() instanceof Boolean) {
            obj.setMsgNotice((Boolean)member.getValue());
          }
          break;
        case "msgToManager":
          if (member.getValue() instanceof Number) {
            obj.setMsgToManager(((Number)member.getValue()).longValue());
          }
          break;
        case "msgToWeixin":
          if (member.getValue() instanceof Number) {
            obj.setMsgToWeixin(((Number)member.getValue()).longValue());
          }
          break;
        case "point":
          if (member.getValue() instanceof String) {
            obj.setPoint((String)member.getValue());
          }
          break;
        case "section":
          if (member.getValue() instanceof String) {
            obj.setSection((String)member.getValue());
          }
          break;
        case "shop":
          if (member.getValue() instanceof String) {
            obj.setShop((String)member.getValue());
          }
          break;
        case "systemAlarm":
          if (member.getValue() instanceof Boolean) {
            obj.setSystemAlarm((Boolean)member.getValue());
          }
          break;
        case "timeSpan":
          if (member.getValue() instanceof String) {
            obj.setTimeSpan((String)member.getValue());
          }
          break;
        case "timeSpanSec":
          if (member.getValue() instanceof Number) {
            obj.setTimeSpanSec(((Number)member.getValue()).longValue());
          }
          break;
        case "timestamp":
          if (member.getValue() instanceof Number) {
            obj.setTimestamp(((Number)member.getValue()).longValue());
          }
          break;
        case "weixinSent":
          if (member.getValue() instanceof Boolean) {
            obj.setWeixinSent((Boolean)member.getValue());
          }
          break;
        case "zhCN":
          if (member.getValue() instanceof String) {
            obj.setZhCN((String)member.getValue());
          }
          break;
      }
    }
  }


  public static void toJson(Alarm obj, java.util.Map<String, Object> json) {
    if (obj.getAlarmDate() != null) {
      json.put("alarmDate", obj.getAlarmDate());
    }
    if (obj.getAlarmNo() != null) {
      json.put("alarmNo", obj.getAlarmNo());
    }
    if (obj.getAlarmSeq() != null) {
      json.put("alarmSeq", obj.getAlarmSeq());
    }
    if (obj.getAlarmTime() != null) {
      json.put("alarmTime", obj.getAlarmTime());
    }
    if (obj.getArea() != null) {
      json.put("area", obj.getArea());
    }
    if (obj.getCloseDate() != null) {
      json.put("closeDate", obj.getCloseDate());
    }
    if (obj.getCloseTime() != null) {
      json.put("closeTime", obj.getCloseTime());
    }
    if (obj.getClosed() != null) {
      json.put("closed", obj.getClosed());
    }
    if (obj.getEnUs() != null) {
      json.put("enUs", obj.getEnUs());
    }
    if (obj.getMaint() != null) {
      json.put("maint", obj.getMaint());
    }
    if (obj.getManagerSent() != null) {
      json.put("managerSent", obj.getManagerSent());
    }
    if (obj.getMdcTag() != null) {
      json.put("mdcTag", obj.getMdcTag());
    }
    if (obj.getMdcTagIndex() != null) {
      json.put("mdcTagIndex", obj.getMdcTagIndex());
    }
    if (obj.getMsgNotice() != null) {
      json.put("msgNotice", obj.getMsgNotice());
    }
    if (obj.getMsgToManager() != null) {
      json.put("msgToManager", obj.getMsgToManager());
    }
    if (obj.getMsgToWeixin() != null) {
      json.put("msgToWeixin", obj.getMsgToWeixin());
    }
    if (obj.getPoint() != null) {
      json.put("point", obj.getPoint());
    }
    if (obj.getSection() != null) {
      json.put("section", obj.getSection());
    }
    if (obj.getShop() != null) {
      json.put("shop", obj.getShop());
    }
    if (obj.getSystemAlarm() != null) {
      json.put("systemAlarm", obj.getSystemAlarm());
    }
    if (obj.getTimeSpan() != null) {
      json.put("timeSpan", obj.getTimeSpan());
    }
    if (obj.getTimeSpanSec() != null) {
      json.put("timeSpanSec", obj.getTimeSpanSec());
    }
    if (obj.getTimestamp() != null) {
      json.put("timestamp", obj.getTimestamp());
    }
    if (obj.getWeixinSent() != null) {
      json.put("weixinSent", obj.getWeixinSent());
    }
    if (obj.getZhCN() != null) {
      json.put("zhCN", obj.getZhCN());
    }
  }
}
